package com.lwc;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.nio.file.Paths;
import java.sql.Types;
import java.util.Collections;

public class CodeGentor {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/lwc", "root", "123456")
                .globalConfig(builder -> builder
                        .author("liwanchao")
                       .outputDir("D:\\桌面\\java\\仓库项目\\warehouse\\ware-core\\src\\main\\java")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.lwc")
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("resources.mybatis.mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .addInclude("admin_user")
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
